#include "mythread.h"
#include <QDebug>
MyThread::MyThread(QObject * parent):QThread (parent)
{
    isStop = false;
}
MyThread::~MyThread(){
    qDebug() << "线程析构" << "\n";
}
//关闭线程
void MyThread::closeThread(){
    isStop = true;
}
void MyThread::run(){
    while(!isStop){
        sleep(1);
        qDebug() << QThread::currentThreadId()<< tr("线程正在运行")<< "\n";
    }
    qDebug() << "线程结束" <<"\n";

}
